package cn.ittaoli.szdz.service.Impl;

import cn.ittaoli.szdz.dao.CxMemberMapper;
import cn.ittaoli.szdz.model.CxMember;
import cn.ittaoli.szdz.service.CxMemberService;
import cn.ittaoli.utils.MD5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by lub_lenovo on 2017/8/16.
 */
@Service
public class CxMemberServiceImpl implements CxMemberService {
    @Autowired
    private CxMemberMapper cxMemberMapper;

    @Override
    public boolean doLogin(CxMember admin, String verify, String codeCorrect) {
        CxMember cxMember=cxMemberMapper.selectByName(admin);
        String md5pass= MD5.GetMD5Code(admin.getPassword());
        if(cxMember.getPassword().equals(md5pass) && verify.equals(codeCorrect)){
            return true;
        }
        return false;
    }
}
